package mall.core.jdbc;

import mall.core.ApplicationProperties;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

@Deprecated
public class JdbcUtils {


    public static Connection getConnection() throws Exception {
        Class.forName(ApplicationProperties.JDBC_DRIVER);
        return DriverManager.getConnection(ApplicationProperties.JDBC_URL, ApplicationProperties.JDBC_USERNAME, ApplicationProperties.JDBC_PASSWORD);

    }


    public static void close(ResultSet rs, Statement state, Connection con) throws Exception {

        if (rs != null) {
            rs.close();
        }
        if (state != null) {
            state.close();
        }
        if (con != null) {
            con.close();
        }
    }
}
